package com.gsn.chooseChannel;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.gsn.dataCommon.ConfigModel;
import com.gsn.desktop.engine.ActorUtility;

public class ListShopGold extends Group {
	ButtonShop buttonShop[];
	ChooseChannelLayer parent;

	// public FlickScrollPane scroll;
	public ListShopGold(ChooseChannelLayer parent) {
		this.parent = parent;

	}

	public void init() {
		clear();
		int i;
		buttonShop = new ButtonShop[ConfigModel.shopModelList.length];
		for (i = 0; i < buttonShop.length; i++) {
			buttonShop[i] = new ButtonShop(i, this);
			addActor(buttonShop[i]);
			if (i != buttonShop.length - 1)
				buttonShop[i].y = (buttonShop.length - 1 - i) * buttonShop[i].height * 1.1f;

		}

		width = buttonShop[0].width;
		height = buttonShop.length * buttonShop[0].height + (buttonShop.length - 1) * buttonShop[0].height * 0.1f;

	}

	public void showParticle(Actor actor, float x, float y) {
		Vector2 v = ActorUtility.getCoordinate(actor, x, y, this);

		parent.showParticle(this, v.x, v.y);

	}
}
